<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div>
        <h3>操作成功</h3>
        <p ><span id="time">5</span>秒后回到主页</p>
    </div>
</body>
</html>
<script type="text/javascript">
    var count = 5;
    window.setInterval(jump,1000);
    function jump() {
        document.getElementById("time").innerText = count;
        if (count <= 1){
            location.href="http://www.baidu.com";
        }
        count--;
    }

</script>